<?php
function reequipment_adminapi_updateshipping($args)
{
    // Get arguments from argument array
    extract($args);

    /* Fields in table.
		shipping_id
		invoice_number
		cost
   */

    // Get datbase setup
    $dbconn =& xarDBGetConn();
    $xartable =& xarDBGetTables();
    $table = $xartable['reshipping'];
    $update = array();
    $bindvars = array();

    // Update item
    $query = "UPDATE $table SET ";
    if (isset($shipping_id)){
        $update[] = "shipping_id = ? ";
        $bindvars[] = $shipping_id;
    }
    if (isset($invoice_number)){
        $update[] = "invoice_number = ? ";
        $bindvars[] = $invoice_number;
    }
    if (isset($cost)){
        $update[] = "cost = ? ";
        $bindvars[] = $cost;
    }        
    if (isset($company_id)){
        $update[] = "company_id = ? ";
        $bindvars[] = $company_id;
    }   
    $query .= join(",",$update);
    $query .= "WHERE shipping_id = ? ";
    $bindvars[] = $shipping_id;
    $result =& $dbconn->Execute($query, $bindvars);
    if (!$result) return;
    return true;
}
?>